#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include"ImageProvider.h"





#pragma comment(linker, "/subsystem:console /entry:mainCRTStartup")
int main(int argc, char *argv[])
{
  

    QGuiApplication app(argc, argv);
    Backend backend;
    qmlRegisterType<ImageProvider>("ImageProvider", 1, 0, "ImageProvider");
    ImageProvider *myProvider;
    myProvider=new ImageProvider();
    QQmlApplicationEngine engine;
    myProvider->setBackend(&backend);
    engine.addImageProvider("ImageProvider",myProvider);
    engine.rootContext()->setContextProperty("backend", &backend);
    QObject::connect(
        &engine,
        &QQmlApplicationEngine::objectCreationFailed,
        &app,
        []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
   // engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
    engine.loadFromModule("shapeMatch", "Main");

    return app.exec();
}
#include "main.moc"
